/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.springvision.yuanfeng.device.entity;

import com.jeeplus.core.persistence.DataEntity;

import java.io.Serializable;

import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 设备消息上报Entity
 * @author 赵博
 * @version 2018-07-17
 */
public class DeviceMessage extends DataEntity<DeviceMessage> implements Serializable {

	private static final long serialVersionUID = 1L;

	private String deviceId;

	private String deviceCode; // 设备编码

	private String reportValue; // 上报数值

	public DeviceMessage() {
		super();
		this.setIdType(IDTYPE_AUTO);
	}

	public DeviceMessage(String id) {
		super(id);
	}

	public DeviceMessage(String deviceCode, String reportValue) {
		super();
		this.deviceCode = deviceCode;
		this.reportValue = reportValue;
	}

	@ExcelField(title = "设备编码", align = 2, sort = 7)
	public String getDeviceCode() {
		return deviceCode;
	}

	public void setDeviceCode(String deviceCode) {
		this.deviceCode = deviceCode;
	}

	@ExcelField(title = "上报数值", align = 2, sort = 8)
	public String getReportValue() {
		return reportValue;
	}

	public void setReportValue(String reportValue) {
		this.reportValue = reportValue;
	}

	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public Device getDevice() {
		Device dev = new Device();
		dev.setCode(this.deviceCode);
		dev.setIsNewRecord(true);
		return dev;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see java.lang.Object#toString()
	 * @author: Elvin Zhao - 279152260@qq.com 
	 * @date: Created on 2018年7月24日 上午10:42:17
	 */
	@Override
	public String toString() {
		return "DeviceMessage [deviceId=" + deviceId + ", deviceCode=" + deviceCode + ", reportValue=" + reportValue
				+ "]";
	}
}